package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.common.domain.enumclass.Whether;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by zhangjh on 2017/3/29.
 *
 * B端 用户表
 */
@Entity
@Table(name = "user_merchant")
@DynamicInsert
@DynamicUpdate
public class UserMerchant extends IDEntityMall {

    @Column(columnDefinition = "bigint comment '用户id'")
    private Long userId;
    @Column(columnDefinition = "bigint comment '平台id'")
    private Long mallId;
    @Column(columnDefinition = "bigint comment '商家id'")
    private Long merchantId;
    @Column(columnDefinition = "varchar(50) comment '用户账号'")
    private String username;
    @Column(columnDefinition = "varchar(50) comment '名称'")
    private String name;
    @Column(columnDefinition = "varchar(50) comment '职称名称'")
    private String titleName;
    @Column(columnDefinition = "bigint comment '职称ID'")
    private Long titleId;
    @Column(columnDefinition = "varchar(50) comment '是否超级管理员'")
    @Enumerated(EnumType.STRING)
    private Whether isSuperAdmin = Whether.NO;
    @Column(columnDefinition = "varchar(50) comment '是否启用'")
    @Enumerated(EnumType.STRING)
    private Whether available = Whether.YES;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Whether getIsSuperAdmin() {
        return isSuperAdmin;
    }

    public void setIsSuperAdmin(Whether isSuperAdmin) {
        this.isSuperAdmin = isSuperAdmin;
    }

    public String getTitleName() {
        return titleName;
    }

    public void setTitleName(String titleName) {
        this.titleName = titleName;
    }

    public Long getTitleId() {
        return titleId;
    }

    public void setTitleId(Long titleId) {
        this.titleId = titleId;
    }

    public Whether getAvailable() {
        return available;
    }

    public void setAvailable(Whether available) {
        this.available = available;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    @Override
    public String toString() {
        return "UserMerchant{" +
                "userId=" + userId +
                ", mallId=" + mallId +
                ", merchantId=" + merchantId +
                ", username='" + username + '\'' +
                ", name='" + name + '\'' +
                ", titleName='" + titleName + '\'' +
                ", titleId=" + titleId +
                ", isSuperAdmin=" + isSuperAdmin +
                ", available=" + available +
                '}';
    }
}
